summaryrefslogtreecommitdiff
path: root/otherlibs/bigarray/bigarray_stubs.c
Commit message (Collapse)AuthorAgeFilesLines
* Move bigarray to the stdlib (#1685)Jérémie Dimino2018-04-091-820/+0
|
* Genarray.nth_dim: add missing bounds checkNicolás Ojeda Bär2018-01-041-1/+1
|
* PR#7505: Memory cannot be released after calling ↵Damien Doligez2017-03-311-3/+4
| | | | Bigarray.Genarray.change_layout.
* runtime: bigarray now uses malloc and free instead of caml_stat_*Max Mouratov2017-03-251-1/+2
| | | | | The allocated memory blocks are freed in the custom block finaliser, so it isn't necessary to use a more complicated memory manager.
* Deprecation of Bigarray.*.map_file and introduction of Unix.map_file, continuedXavier Leroy2017-03-131-474/+1
| | | | | | | | | | | | | | | | This is a follow-up to GPR #997 with a different implementation that creates fewer dependencies. We add to the runtime a `byterun/bigarray.c` file that contains the bigarray creation functions that used to be in `otherlibs/bigarray/bigarray_stubs.c`. In the latter file we keep all primitives needed to implement the Bigarray interface. The functions in the new `byterun/bigarray.c` make it possible to create bigarrays both from the bigarray library and from the unix library. The header file `bigarray.h` moves to `byterun/caml/bigarray.h` accordingly. The `map_file` implementations move to `otherlibs/unix/mmap.c` and `otherlibs/win32unix/mmap.c`. Some bigarray allocation code shared between the two implementations is put in `otherlibs/unix/mmap_ba.c`. Through a couple of `#ifdef`, the `map_file` implementations can also be compiled from within `otherlibs/bigarray` with the same semantics they had in 4.04. As a consequence, the bigarray library still contains a standalone, Unix-independent implementation of `Bigarray.*.map_file`; the only difference with 4.04 is that it is marked deprecated. Current status: compiled and lightly tested under Unix. Win32 implementation neither compiled nor tested.
* Assertions cleanupSébastien Hinderer2017-03-131-8/+8
| | | | | | | | | | | | | | | | | Replace a few occurrences of assert and many occurrences of Assert by CAMLassert. In asmrun/spacetime_snapshot.c, the line Assert(0); /* unreachable */ in the function caml_spacetime_shape_table has been removed rather than replaced because the caml_failwith function called just above has the noreturn attribute which should be enough to keep compilers happy. The same holds in the function caml_spacetime_only_works_for_native_code defined in byterun/spacetime.c
* Add runtime functions for integer arithmetic with checked overflowXavier Leroy2017-02-251-49/+7
| | | | | | | | | | | | | | | | As suggested in MPR#7492 and developed in GPR#1060. This is a first step towards more safety against overflows in the runtime system. Currently, addition, subtraction and multiplication are provided at type "uintnat". The implementation uses GCC / Clang builtins if available, or portable C code otherwise. Overflow-detecting multiplication was already defined and used in otherlibs/bigarrays/bigarray_stubs.c. The bigarray code was adapted to use the new runtime functions. Squashed commit of the following: commit e83f9f6d367e55bb289a420dc49aea239cdd6aa5 commit 2a3dc18065d2f0478b035633dcc340d62c0830fc commit 590384b6eba45ed7419ed438d1c4aeca57ce6d3d commit aef4ff2300ddfe24ffd4905494b85fda78893fd7 commit 41f5bcbea2b54a096e8b689ad0ab3f5d8cb38e15 commit 227b6d6033e326a31170cb30380a364c23252e80
* bigarray: fixed a typo in a commentMax Mouratov2017-02-231-1/+1
|
* bigarray: added a missing #undef (doesn't affect semantics)Max Mouratov2017-02-231-0/+1
|
* bigarray_stubs.c: fix code raising a legitimate clang warningGabriel Scherer2016-09-011-2/+4
|
* Support the '0 dimension case' for bigarrays (#787)Laurent Mazare2016-09-011-5/+5
| | | Bigarray: support 0-dimension bigarrays (just a scalar value), with an Array0 module
* fix whitespace, long lines, headersDamien Doligez2016-08-011-3/+3
|
* Install all include files, and access internals with CAML_INTERNALSFabrice Le Fessant2016-07-121-0/+2
|
* Corrected a small bug in the allocation of the new dimensions in ↵Guillaume Hennequin2016-05-221-1/+1
| | | | [Genarray.change_layout].
* No reallocation when the layout doesn't change.Guillaume Hennequin2016-05-211-11/+12
| | | | Added spaces around binary operators.
* Now reversing the dimensions in [change_layout].Guillaume Hennequin2016-05-201-4/+11
|
* Added a function [Genarray.change_layout].Guillaume Hennequin2016-05-201-0/+18
|
* Update headers for the new license.Damien Doligez2016-02-181-12/+14
| | | | Remains to be done: remove all headers in testsuite/tests.
* fix commit 15947: MS compiler does not handle 'inline'Damien Doligez2015-03-181-5/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15950 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#4832: Filling bigarrays may block out runtimeflambda_fork_pointDamien Doligez2015-03-171-14/+51
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15947 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5887: move the byterun/*.h headers to byterun/caml/*.h to avoid header ↵Gabriel Scherer2014-12-271-7/+7
| | | | | | | | | name clashes (Jérôme Vouillon and Adrien Nader and Peter Zotov) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* merge changes of version/4.02 from r15121 to r15155Damien Doligez2014-08-291-3/+3
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#6517: use ISO C99 types {,u}int{32,64}_t in preference to our homegrownXavier Leroy2014-08-271-24/+24
| | | | | | | types {,u}int{32,64}. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15131 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#6075: avoid using unsafe C library functions (strcpy, strcat, sprintf).Xavier Leroy2014-04-151-44/+26
| | | | | | | | | | An ISO C99-compliant C compiler and standard library is now assumed. (Plus special exceptions for MSVC.) In particular, emulation code for 64-bit integer arithmetic was removed, the C compiler must support a 64-bit integer type. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14607 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#6064: GADT representation for Bigarray.kind + CAML_BA_CHAR runtime kindGabriel Scherer2014-01-091-6/+17
| | | | | | Patch by Jeremy Yallop and Leo P. White git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14391 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* #5774: fix MSVC port.Alain Frisch2012-12-191-25/+31
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13141 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5771: Add primitives for reading 2, 4, 8 bytes in strings and bigarraysFabrice Le Fessant2012-11-091-0/+149
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13087 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5762: Add primitives for fast access to bigarray dimensionsFabrice Le Fessant2012-11-061-0/+15
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13069 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* remove all $Id keywordsDamien Doligez2012-10-151-2/+0
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Refactoring of the computations of the actual size of a struct caml_ba_arrayXavier Leroy2012-10-071-17/+3
| | | | | | | (related to PR#5516 and PR#5761). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12993 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5761: Incorrect bigarray custom block sizeDamien Doligez2012-09-271-0/+10
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12964 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Remove the 'dispose' functions from Bigarray. Xavier Leroy2012-05-061-14/+2
| | | | | | | (Partial revert of commit 12327, keeping the other good bits.) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12432 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#3571: in Bigarrays, call msync() before unmapping to commit changesXavier Leroy2012-04-091-2/+14
| | | | | | | | | | PR#5463: Bigarray.*.map_file fail if empty array is requested Bigarray: added "release" functions that free memory and file mappings just like GC finalization does eventually, but does it immediately. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12327 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5516 continued: it seems that some compilers define __GNUC__ yet don't ↵Xavier Leroy2012-04-031-2/+2
| | | | | | implement flexible arrays as a GCC extension, so use flex arrays iff C99. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12312 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5516: in Bigarray C stubs, use C99 / GCC flexible array types if possibleXavier Leroy2012-02-271-7/+11
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12188 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5511: in Bigarray.reshape, unwarranted limitation on new array dimensionsXavier Leroy2012-02-211-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12180 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* More renaming to OCamlDamien Doligez2012-02-101-7/+7
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12149 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* renaming of Objective Caml to OCaml and cleanup of copyright headersDamien Doligez2011-07-271-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#5290: added hash functions for channels, nats, mutexes, conditions.Xavier Leroy2011-07-231-1/+2
| | | | | | | | | Also: added "custom_compare_ext_default" to all struct custom_operations: default initialization to 0 did what we want, but explicit initialization better documents the C sources. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11143 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* merge changes from 3.12.0 to 3.12.1Damien Doligez2011-07-201-0/+5
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11123 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Better hashing!Xavier Leroy2011-05-291-32/+49
| | | | | | | | | | | - New generic hash function based on Murmur 3, with better statistical properties (PR#5225), and better speed - Make sure equal floats hash equally (PR#5222) - Breadth-first traversal instead of depth-first - Added seeded hash functions and seeded functorial interface to Hashtbl. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11056 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* merge changes from 3.10.2merged to 3.11.0Damien Doligez2008-12-031-4/+4
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9153 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#4457: no need to limit each bigarray dimension to 2^31.Xavier Leroy2008-01-041-218/+229
| | | | | | | Name space depollution. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8748 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* PR#1956 renommage: bigarray est prefixe par ocaml_ba_Damien Doligez2006-01-271-119/+119
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7341 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Remplacement long/unsigned long par intnat/uintnatXavier Leroy2005-09-221-80/+81
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7064 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* fusion des changements jusqu'a 3.08.3Damien Doligez2005-03-241-1/+0
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6824 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* decontamination (PR#1914, PR#1956)Damien Doligez2003-12-151-2/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6021 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Se proteger contre les debordements lorsqu'on calcule la taille d'un nouveau ↵Xavier Leroy2003-11-211-19/+92
| | | | | | | | | bigarray. Revu comparaisons flottantes. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5958 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* Export de alloc_bigarray (PR#1519)Xavier Leroy2003-07-081-2/+2
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5673 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* accolade mal placeeDamien Doligez2003-02-251-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5407 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02