Skip to content

Commit

Permalink
* changed type for sizeof_type in create routines to size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
mulle-nat committed Jan 12, 2024
1 parent 56a35d7 commit 8a1d027
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ mulle-markdown-preview-*.html
coverage*.html
*.gcda
*.gcno
cola/wilted/
1 change: 1 addition & 0 deletions .mulle/etc/match/match.d/86-header--project-only-headers

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .mulle/share/env/environment-extension.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .mulle/share/env/motd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .mulle/share/match/match.d/86-header--project-only-headers

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .mulle/share/sde/version/mulle-c/c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .mulle/share/sde/version/mulle-c/c-demo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .mulle/share/sde/version/mulle-sde/c-cmake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .mulle/share/sde/version/mulle-sde/c-demo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ Some data structures utilize callbacks that are compatible to OS X's
[`NSHashtable`](//nshipster.com/nshashtable-and-nsmaptable/) and friends.



| Release Version | Release Notes
|-------------------------------------------------------|--------------
| ![Mulle kybernetiK tag](https://img.shields.io/github/tag/mulle-c/mulle-container.svg?branch=release) [![Build Status](https://github.com/mulle-c/mulle-container/workflows/CI/badge.svg?branch=release)](//github.com/mulle-c/mulle-container/actions)| [RELEASENOTES](RELEASENOTES.md) |
| ![Mulle kybernetiK tag](https://img.shields.io/github/tag/mulle-c/mulle-container.svg?branch=release) [![Build Status](https://github.com/mulle-c/mulle-container/workflows/CI/badge.svg?branch=release)](//github.com/mulle-c/mulle-container/actions) ![Coverage](https://img.shields.io/badge/coverage-81%25%C2%A0-goldenrod) | [RELEASENOTES](RELEASENOTES.md) |


/home/src/srcO/mulle-c/mulle-container()
/home/src/srcO/mulle-c/mulle-container
## Data Structures

The names of the functions are consistent. Each function is a **verb**
Expand Down Expand Up @@ -444,7 +445,7 @@ cmake --install build --config Release

## Author

[Nat!](https://mulle-kybernetik.com/weblog) for Mulle kybernetiK
[Nat!](https://mulle-kybernetik.com/weblog) for Mulle kybernetiK



33 changes: 33 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# 8.0.0

* changed type for `sizeof_type` in create routines to `size_t`
* add lots more convenience functions that were missing like for example `mulle_array_find`
* `_mulle_structarray_set` added (not sure if these array set functions won't all be renamed to `set_at_index)`
* **BREAKING CHANGES** renamed a lot of functions that were named "search" to "find" as they werent binary searches
* fixed rarely if ever used "shrink" code of various containers
* added `mulle__pointermap_remove`
* add a lot of functions to `mulle__array_add` for completeness
* rename `_mulle__pointerarray_absorb` to `_mulle__pointerarray_absorb_array` to be more inline with other two array functions
* add sorting to `_mulle_pointerarray` and `_mulle__structarray`
* add `mulle__assoc_create,` `mulle_assoc_find` and `mulle_assoc_find_in_range,` which where missing
* **BREAKING** `insert_value_forkeys` functions are now renamed to `insert_key_values` and the order of keys and values is reversed, which is technically better, because now you don't need two NULLs to terminate the arguments, but just one
* The `copy_items` functions no longer return an error code
* the struct queue and array gain a new field `"copy_sizeof_struct"` so that there should be no reading off to much memory on input now, which could conceivably page fault when alignment is needed to expand the items
* **BREAKING** the function `_mulle__pointermap_describe` has been removed as it was unused
* added mulle-pointerset more or less for the convenience of writing test code for mulle--pointerset-generic
* **BREAKING** `mulle_uniquepointerarray` is now completely superflous and was removed as mulle-pointerset exists now
* added `_do` convenience temporary constructors to most if not all containers
* added `mulle__pointermap_find_by_value`
* add sort routines to pointerarray and array
* add structqueue as an alternative to structarray
* **BREAKINK CHANGE** `mulle_flexarray` now also defines the `<type>` *name argument and you don't have to assign the return value of alloc anymore to it. This makes it easier to work with, especially if you are mostly using `mulle_flexarray_do` and only sometimes need more control
* `mulle__pointerarray` gains zeroing functions. This allows random access to a pointer array, so that the unused portions are filled up with zeroes. This is not sparse though!
* finally there is a `_mulle__structarray_set_count` to explicitly grow or shrink a struct array
* **BREAKING CHANGE** `_mulle__assoc_set` has been renamed to `__mulle_assoc_set_at_index`
* if your `mulle_assoc` is `intptr_t` key base, you can now easily remap or move key ranges sometimes even without the need for memory coyping
* new function `_mulle_pointerpair_bsearch_or_less`
* callback `mulle_container_keycallback_intptr_is_equal` is now actually its own function, to be able to discern it when inspecting a callback
* mulle-qsort added as `qsort_r` is not cross-platform and I want to support it for bsearch
* added **mulle-assoc** an associative array as an alternative to mulle-map


# 7.0.0

* remove package.json as it conflicts with clib.json
Expand Down
2 changes: 1 addition & 1 deletion clib.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "mulle-container",
"version" : "8.0.0",
"description" : "Arrays, hashtables and a queue",
"description" : "🛄 Arrays, hashtables and a queue",
"keywords" : [],
"license" : "BSD-3-Clause",
"repo" : "mulle-c/mulle-container",
Expand Down
11 changes: 7 additions & 4 deletions cmake/share/Environment.cmake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cmake/share/Headers.cmake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/queue/struct/mulle--structqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int __mulle__structqueueenumerator_next( struct mulle__structqueueenumerator *


struct mulle__structqueue *
mulle__structqueue_create( unsigned int sizeof_struct,
mulle__structqueue_create( size_t sizeof_struct,
unsigned int alignof_struct,
unsigned short bucket_size,
unsigned short spare_allowance,
Expand Down Expand Up @@ -103,7 +103,7 @@ void


void _mulle__structqueue_grow( struct mulle__structqueue *queue,
struct mulle_allocator *allocator)
struct mulle_allocator *allocator)
{
struct mulle__structqueuebucket *p;
struct mulle__structqueuebucket *q;
Expand Down
2 changes: 1 addition & 1 deletion src/queue/struct/mulle--structqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static inline void

MULLE__CONTAINER_GLOBAL
struct mulle__structqueue *
mulle__structqueue_create( unsigned int sizeof_struct,
mulle__structqueue_create( size_t sizeof_struct,
unsigned int alignof_struct,
unsigned short bucket_size,
unsigned short spare_allowance,
Expand Down
2 changes: 1 addition & 1 deletion src/queue/struct/mulle-structqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@


struct mulle_structqueue *
mulle_structqueue_create( unsigned int sizeof_struct,
mulle_structqueue_create( size_t sizeof_struct,
unsigned int alignof_struct,
unsigned short bucket_size,
unsigned short spare_allowance,
Expand Down
16 changes: 15 additions & 1 deletion src/queue/struct/mulle-structqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static inline void mulle_structqueue_init( struct mulle_structqueue *queue,
allocator);
}


static inline void
mulle_structqueue_init_default( struct mulle_structqueue *queue,
size_t sizeof_struct,
Expand All @@ -138,12 +139,25 @@ static inline void

MULLE__CONTAINER_GLOBAL
struct mulle_structqueue *
mulle_structqueue_create( unsigned int sizeof_struct,
mulle_structqueue_create( size_t sizeof_struct,
unsigned int alignof_struct,
unsigned short bucket_size,
unsigned short spare_allowance,
struct mulle_allocator *allocator);


static inline struct mulle_structqueue *
mulle_structqueue_create_default( size_t sizeof_struct,
unsigned int alignof_struct,
struct mulle_allocator *allocator)
{
return( mulle_structqueue_create( sizeof_struct,
alignof_struct,
256,
16,
allocator));
}

MULLE_C_NONNULL_FIRST
static inline
void _mulle_structqueue_destroy( struct mulle_structqueue *queue)
Expand Down
4 changes: 2 additions & 2 deletions src/reflect/_mulle-container-provide.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*
* mulle-sde environment set MULLE_MATCH_TO_C_RUN DISABLE
*/
#ifndef mulle_container_provide_h__
#define mulle_container_provide_h__
#ifndef _mulle__container__provide_h__
#define _mulle__container__provide_h__


#include "mulle--array.h"
Expand Down

0 comments on commit 8a1d027

Please sign in to comment.