An ANSI C hash table implementation with data in one block of memory

I am looking for an open source C implementation of a hash table that stores all the data in one block of memory, so it can be easily sent over the network, say. I can only find those that allocate small pieces of memory for each pair of keys and values ​​added to it.

Thanks in advance for all the inputs.

EDIT: It is not necessary to be a hash table, any table of key and value pairs is probably done.

+3
source share
4 answers

On a unix system, I would use a shared memory buffer (see shm_open()), or if it is not available, -mapped memory with the MAP_SHARED flag, see the differences in the OS, but http://en.wikipedia.org/wiki/Mmap

shm_open mmap , ( ), , , , , , (// ..).

- , , , /. , -, , ///etc.

, .

+1

​​ ( ), , ​​ ( ), . , , ", ".

, , :

  • / ( , , )

, +.

+6

(+1). . , , , , , , , 1/2/3 , - (, ).

0

, -, , ( , , -), , , , 't " ", .

( unserialize) - . , (, - , "", ).

0

Source: https://habr.com/ru/post/1755454/


All Articles