Skip to content

Commit

Permalink
Fix a warning on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescAlted committed Jul 30, 2024
1 parent bb66cce commit 253c2cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
9 changes: 5 additions & 4 deletions ANNOUNCE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Announcing C-Blosc2 2.15.0
# Announcing C-Blosc2 2.15.1
A fast, compressed and persistent binary data store library for C.

## What is new?

This is a minor release in which a new io mode
was added to memory-map files. Furthermore, the `io_cb` read API was changed, so the
`SOVERSION` was bumped. In addition, the internal zstd sources were updated to 1.5.6 and some
This is a maintenance release in which we are fixing calling instructions
more advanced than available in current CPU, causing a SIGKILL.
Furthermore, a new `b2nd_nans` function has been added. In addition,
the internal LZ4 sources were updated to 1.10.0 and some
other improvements were made.

For more info, please see the release notes in:
Expand Down
10 changes: 10 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ Release notes for C-Blosc2
Changes from 2.15.0 to 2.15.1
=============================

* Do not pass `-m` flags when compiling `shuffle.c`. This prevents the
compiler from incidentally optimizing the code called independently
of the runtime CPU check to these instruction sets, effectively
causing `SIGILL` on other CPUs. Fixes #621. Thanks to @t20100 and @mgorny.

* Internal LZ4 sources bumped to 1.10.0.

* Allow direct loading of plugins by name, without relying on
the presence of python. Thanks to @boxerab.

* Add `b2nd_nans` method (PR #624). Thanks to @waynegm.


Changes from 2.14.4 to 2.15.0
=============================
Expand Down
6 changes: 3 additions & 3 deletions blosc/blosc2-stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void *blosc2_stdio_mmap_open(const char *urlpath, const char *mode, void* params
_print_last_error();
BLOSC_TRACE_ERROR("Cannot close the handle to the memory-mapped file.");
}

return NULL;
}
#else
Expand Down Expand Up @@ -353,7 +353,7 @@ int64_t blosc2_stdio_mmap_write(const void *ptr, int64_t size, int64_t nitems, i
_print_last_error();
BLOSC_TRACE_ERROR("Cannot close the handle to the memory-mapped file.");
}

return 0;
}

Expand All @@ -373,12 +373,12 @@ int64_t blosc2_stdio_mmap_write(const void *ptr, int64_t size, int64_t nitems, i
}

if (mmap_file->mapping_size < mmap_file->file_size) {
int64_t old_mapping_size = mmap_file->mapping_size;
mmap_file->mapping_size = mmap_file->file_size * 2;

#if defined(__linux__)
/* mremap is the best option as it also ensures that the old data is still available in c mode. Unfortunately, it
is no POSIX standard and only available on Linux */
int64_t old_mapping_size = mmap_file->mapping_size;
char* new_address = mremap(mmap_file->addr, old_mapping_size, mmap_file->mapping_size, MREMAP_MAYMOVE);
#else
if (mmap_file->is_memory_only) {
Expand Down

0 comments on commit 253c2cc

Please sign in to comment.