1Judy::Mem(3)          User Contributed Perl Documentation         Judy::Mem(3)
2
3
4

NAME

6       Judy::Mem - Useful functions for interacting with memory
7

DATA TYPES

9   $Ptr - pointer
10   $String - perl string
11   $Length - integer

FUNCTIONS

13   $Ptr = String2Ptr( $String )
14       Copies $String into a new C string. The allocated string will be large
15       enough to hold your perl string regardless of whether it uses multi-
16       byte characters, or has null characters.
17
18       You'll need to be careful to free this copy later when you're done with
19       it.
20
21   $String = Ptr2String( $Ptr )
22       Dereferences $Ptr and copies it into a new perl string. Doesn't do
23       anything about Unicode, multibyte encoding, or null characters. In
24       fact, if you have nulls in your data, your copied string will be
25       truncated. Use the other function "Ptr2String2" which allows you to
26       pass in the byte length.
27
28   $String = Ptr2String2( $Ptr, $Length )
29       Dereferences $Ptr and copies it into a new perl string. Doesn't do
30       anything about Unicode, multibyte encoding. See the Encode and utf8
31       about flipping the Perl utf8 bits.
32
33   Free( $Ptr )
34       Frees a pointer. You should be using this function on any pointer you
35       previously allocated with String2Ptr or String2Ptr2.
36
37   $Int = Peek( $Ptr )
38       Reads an integer out of memory. This is equivalent to:
39
40         (Word_t)*ptr
41
42   Poke( $Ptr, $Int )
43       Writes an integer to memory. This is equivalent to to C code:
44
45         *ptr = (Word_t)val;
46

ERRORS & WARNINGS

48       See Judy.
49

AUTHOR

51       See Judy.
52
53
54
55perl v5.30.0                      2019-07-26                      Judy::Mem(3)
Impressum