__DL__ has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has quit ["br[?]b.... sharing phone line"]
docelic is now known as docelic|sleepo
Smerdyakov has joined #ocaml
stefp has quit [Read error: 110 (Connection timed out)]
Riastrad1 is now known as Riastradh
lsr has quit [Read error: 54 (Connection reset by peer)]
Vincenz has quit []
lament has joined #ocaml
lament has left #ocaml []
Smerdyakov has quit ["bye bye MackTheKnife"]
Kinners has joined #ocaml
kjs3 has joined #ocaml
Kinners has left #ocaml []
kjs3 has left #ocaml []
Yurik__ is now known as Yurik
firstein has joined #ocaml
wax has quit [Remote closed the connection]
wax has joined #ocaml
firstein_ has joined #ocaml
firstein has quit [Read error: 60 (Operation timed out)]
docelic|sleepo is now known as docelic|away
d-bug has joined #ocaml
Yurik_ has joined #ocaml
Yurik has quit [Read error: 104 (Connection reset by peer)]
Yurik_ is now known as Yurik
firstein__ has joined #ocaml
firstein_ has quit [Read error: 60 (Operation timed out)]
mattam has joined #ocaml
kosmikus has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
rhil has quit ["Lost terminal"]
rhil has joined #ocaml
karryall has quit ["brb"]
karryall has joined #ocaml
drlion_ has joined #ocaml
drlion has quit [Read error: 110 (Connection timed out)]
gene9 has joined #ocaml
docelic|away is now known as docelic
mrvn_ has joined #ocaml
drlion_ has quit [Read error: 110 (Connection timed out)]
mrvn has quit [Read error: 110 (Connection timed out)]
systems has joined #ocaml
systems has left #ocaml []
Riastradh has quit [calvino.freenode.net irc.freenode.net]
reltuk has quit [calvino.freenode.net irc.freenode.net]
Riastradh has joined #ocaml
Yurik_ has joined #ocaml
Yurik has quit [Read error: 54 (Connection reset by peer)]
reltuk has joined #ocaml
Smerdyakov has joined #ocaml
firstein_ has joined #ocaml
lus|wazze has joined #ocaml
docelic is now known as docelic|away
firstein__ has quit [Read error: 60 (Operation timed out)]
gorgias has joined #ocaml
<gorgias>
Hi guys, I've got a question regarding Bigarray.maf_file: how do I unmap a file?
<Smerdyakov>
I'm not familiar with this at all, but: if what that function does is return you an array of the file contents, I bet it's "unmapped" when that array is garbage collected.
gene9 has quit []
drlion has joined #ocaml
lus|wazze has quit ["Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Univ]
lus|wazze has joined #ocaml
__DL__ has joined #ocaml
d-bug has quit ["bye"]
<gorgias>
Sorry Smerdyakov, for the delay
<gorgias>
I just got a mail that needed quick answering (nonmaskable interrupt)
<gorgias>
;-)
<gorgias>
In my case, garbage collected unmapping does not really help
<gorgias>
I would like to map pages for an index structure on disk, and sometimes I will have to add pages
<gorgias>
So I would like to unmap, add something to the file and than re-map
<Smerdyakov>
You can't add something to the file while it's mapped?
<gorgias>
Yes, I can,
<gorgias>
but I would like the array to grow too
<gorgias>
But your question is right
<gorgias>
I should test more deeply before bothering this channel
stefp has joined #ocaml
<gorgias>
I just hoped that someone had already run into that problem
<gorgias>
and could give me a one-line-howto :-D
<Smerdyakov>
I think one would hope that garbage collection would handle any problems like this.
<Smerdyakov>
You should be able to map the same file twice and rely on GC to free memory if you go over a limit determined by some policy.
<gorgias>
OK. I will test all that
<gorgias>
I'll be back in some weeks (as I should really worry about getting the index going in the first place)
<gorgias>
Cheers (gorgias trots off to tuareg)
Smerdyakov has quit ["eat"]
gorgias has quit ["Client exiting"]
<mrvn_>
How do I mmap in ocaml?
<mrvn_>
and more importantly how do I get the GC to allocate objects in an mmpaed region?
reltuk has quit []
karryall has quit ["tcho"]
<__DL__>
mrvn : look to the bigarray library
<__DL__>
but I don't believe you can do the last one...
firstein__ has joined #ocaml
Smerdyakov has joined #ocaml
phubuh has joined #ocaml
<phubuh>
hey guys
<phubuh>
what's most efficient for storing small (<100 elements) arrays of 32-bit integers? how about 8-bit?
<phubuh>
the int32 types with friends are all warned to be slow and big, but i see no such warnings for bigarray
<lus|wazze>
bigarrays are meant for doing just that
<lus|wazze>
i would use strings for storing small amounts of 8-bit unsigned integers, i.e. bytes, though
<phubuh>
ah, okay. thanks!
<phubuh>
are int literals automatically converted to int32 when used as such?
<lus|wazze>
nope
<lus|wazze>
you have to use Int32.of_int
<phubuh>
oh, okay
firstein_ has quit [Connection timed out]
<phubuh>
ugh. i want a bigarray of unsigned int32s :/
<lus|wazze>
ah yes the usage of the bigarray library can be a bit confusing at first
<phubuh>
yeah :)
<lus|wazze>
# Array1.create;;
<lus|wazze>
- : ('a, 'b) Bigarray.kind ->
<lus|wazze>
'c Bigarray.layout -> int -> ('a, 'b, 'c) Bigarray.Array1.t
<lus|wazze>
ok the kind argument specifies the element type
<phubuh>
yeah, but there is no int32_unsigned
<lus|wazze>
there are several predefined constants for this in the Bigarray module
<lus|wazze>
ah
<lus|wazze>
yes int32`s are always signed
<lus|wazze>
hm
<lus|wazze>
as int32`s are supposed to be in 2's complement form anyway it shouldn't make a difference except for multiplication
<lus|wazze>
yeah there is no unsigned int32 type so there is accordingly no such bigarray member type :(
docelic|away is now known as docelic
<mrvn_>
Why not just use ints? Thats only 50% waste.
<mrvn_>
And way faster and comforatble than Int32
<mrvn_>
.oO( Or do you ahve one of those old 32 Bit cpus with tiny ints? )
<phubuh>
i was going to implement sha1, which would be very ugly without 32 bit integers
<mrvn_>
phubuh: don't, use openssl
<phubuh>
oh, there's an o'caml binding? does openssl have sha1?
<mrvn_>
Message Digest commands (see the `dgst' command for more details)
<mrvn_>
md2 md4 md5 rmd160 sha
<mrvn_>
sha1
<mrvn_>
phubuh: Its way easier tpo make ocaml bindings for openssl than to implement sha1.
<phubuh>
heh.
<mrvn_>
And send them my way when you have them. I'm going to need them too.
kosmikus has quit ["leaving"]
systems has joined #ocaml
docelic has quit ["Client Exiting"]
docelic has joined #ocaml
mattam_ is now known as mattam
systems has quit ["Client Exiting"]
Smerdyakov has quit ["I am gone!"]
<mrvn_>
Whats the best way to test a Hashtbl for emptyness?