Skip to main content

Questions tagged [pointers]

For questions about pointers, values that refer to memory addresses where other data values are stored

Filter by
Sorted by
Tagged with
3 votes
0 answers
163 views

Is there a downside to using offsets instead of raw pointers in a virtual machine?

Say I'm designing a virtual machine for a bytecode compiler/interpreter, using C as the implementation language. Some kind of “tagged” representation of values is simplest for this language, where ...
texdr.aft's user avatar
  • 303
3 votes
1 answer
129 views

Compressed pointers, why not "relative" rather than "base" encoding?

Java has compressed oops, NodeJS has compressed pointers, they all use a common "base" address to encode/decode pointer values. There is an obvious downside: total heap size get rather ...
Compl Yue's user avatar
3 votes
1 answer
199 views

How to save C struct pointers in interpreted language? [closed]

I am making an interpreter based on the lox from the book Crafting Interpretes. I have modified the language implementation heavily but the core still remains the same. Currently I am adding standard ...
Timsib Adnap's user avatar
3 votes
2 answers
432 views

What are the implications of NaN-Boxing?

I recently heard about NaN-Boxing as an alternative to tagging for pointers. What would implementing NaN-Boxing really mean for a language? Primarily, I'm wondering whether it would limit the ...
Lucas Stertz's user avatar
2 votes
1 answer
244 views

Are there languages making addresses to have other significant meaning?

Some examples: To support checking whether an object is of a subclass of a specific class in constant time, in a language using single inheritance, the compiler could arrange the vtables of classes ...
user23013's user avatar
  • 2,510
2 votes
1 answer
259 views

Implementing a Array programming language in C. What is the best and most efficient struct for the arrays? [closed]

...
rapasite's user avatar
3 votes
4 answers
283 views

Common postfix representations of pointer/reference operations

In some C-based languages (including C/C++ themselves and Rust), taking pointers/references and dereferencing is done with prefix operators & and ...
abel1502's user avatar
  • 2,527
11 votes
4 answers
618 views

Can a language allow raw pointer dereferencing while preserving memory safety?

In Rust, creating a raw pointer is allowed in safe code (i.e. outside of unsafe blocks), but then dereferencing it is unsafe: ...
mousetail's user avatar
  • 8,359
6 votes
2 answers
287 views

How are C++ style references implemented behind the scenes? Could they be implemented without pointers?

I would not be surprised if C++ style int &y = x; was no more than int *y = &x; behind the scenes and every use of ...
CPlus's user avatar
  • 8,321
7 votes
4 answers
398 views

What are the advantages of allowing users to directly handle memory addresses with pointers?

Pointers are variables that store a memory address. They allow the programmer to directly deal with memory which can be used to pass variables by reference or even for performance reasons. However, ...
FireTheLost's user avatar
  • 1,613